00001
00002
00003 #pragma once
00004 #include "stdafx.h"
00005 #include "TraffEdu.h"
00006 #include "MainFrm.h"
00007 #include "0SGWindows/OsgWindows.h"
00008 #include "EnvObjectsForm.h"
00009 #include ".\envobjectsform.h"
00010 #include "SignForm.h"
00011 #include "RoadForm.h"
00012 #include "VehicleForm.h"
00013 #include "LightForm.h"
00014 #include "splitter.h"
00015
00016
00017
00018
00019
00020 IMPLEMENT_DYNCREATE(EnvObjectsForm, CFormView)
00021
00022 EnvObjectsForm::EnvObjectsForm()
00023 : CFormView(EnvObjectsForm::IDD)
00024 {
00025 m_h_icon_house = static_cast<HICON>(LoadImage (theApp.m_hInstance, MAKEINTRESOURCE(IDI_ICON38),
00026 IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR));
00027 m_h_icon_tree = static_cast<HICON>(LoadImage (theApp.m_hInstance, MAKEINTRESOURCE(IDI_ICON37),
00028 IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR));
00029 }
00030
00031 EnvObjectsForm::~EnvObjectsForm()
00032 {
00033 }
00034
00035 void EnvObjectsForm::DoDataExchange(CDataExchange* pDX)
00036 {
00037 CFormView::DoDataExchange(pDX);
00038 DDX_Control(pDX, IDC_BUTTON6, m_button_house);
00039 DDX_Control(pDX, IDC_BUTTON7, m_button_tree);
00040 }
00041
00042 BEGIN_MESSAGE_MAP(EnvObjectsForm, CFormView)
00043 ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1)
00044 ON_BN_CLICKED(IDC_BUTTON2, OnBnClickedButton2)
00045 ON_BN_CLICKED(IDC_BUTTON3, OnBnClickedButton3)
00046 ON_BN_CLICKED(IDC_BUTTON4, OnBnClickedButton4)
00047 ON_BN_CLICKED(IDC_BUTTON6, OnBnClickedButton6)
00048 ON_BN_CLICKED(IDC_BUTTON7, OnBnClickedButton7)
00049 END_MESSAGE_MAP()
00050
00051
00052
00053
00054 #ifdef _DEBUG
00055 void EnvObjectsForm::AssertValid() const
00056 {
00057 CFormView::AssertValid();
00058 }
00059
00060 void EnvObjectsForm::Dump(CDumpContext& dc) const
00061 {
00062 CFormView::Dump(dc);
00063 }
00064 #endif //_DEBUG
00065
00066 void EnvObjectsForm::OnInitialUpdate()
00067 {
00068 CFormView::OnInitialUpdate();
00069 m_button_house.SetIcon (m_h_icon_house);
00070 m_button_tree.SetIcon (m_h_icon_tree);
00071 }
00072
00073
00074 void EnvObjectsForm::OnBnClickedButton1()
00075 {
00076 C4WaySplitter* pParentSplitter = (C4WaySplitter*)GetParent();
00077 pParentSplitter->ReplaceView(RUNTIME_CLASS(RoadForm));
00078 }
00079
00080 void EnvObjectsForm::OnBnClickedButton2()
00081 {
00082 C4WaySplitter* pParentSplitter = (C4WaySplitter*)GetParent();
00083 pParentSplitter->ReplaceView(RUNTIME_CLASS(VehicleForm));
00084 }
00085
00086 void EnvObjectsForm::OnBnClickedButton3()
00087 {
00088
00089 C4WaySplitter* pParentSplitter = (C4WaySplitter*)GetParent();
00090 pParentSplitter->ReplaceView(RUNTIME_CLASS(LightForm));
00091 }
00092
00093 void EnvObjectsForm::OnBnClickedButton4()
00094 {
00095
00096 C4WaySplitter* pParentSplitter = (C4WaySplitter*)GetParent();
00097 pParentSplitter->ReplaceView(RUNTIME_CLASS(SignForm));
00098
00099 }
00100
00101 void EnvObjectsForm::OnBnClickedButton6()
00102 {
00103
00104 C4WaySplitter* pParentSplitter = (C4WaySplitter*)GetParent();
00105 CMainFrame *pFrame = reinterpret_cast<CMainFrame*>(pParentSplitter->GetParentFrame());
00106
00107 pFrame->drawMode = DRAW_HOUSE;
00108
00109 }
00110
00111 void EnvObjectsForm::OnBnClickedButton7()
00112 {
00113
00114 C4WaySplitter* pParentSplitter = (C4WaySplitter*)GetParent();
00115 CMainFrame *pFrame = reinterpret_cast<CMainFrame*>(pParentSplitter->GetParentFrame());
00116
00117 pFrame->drawMode = DRAW_TREE;
00118
00119 }